package cclub.demo.utils;

import lombok.extern.slf4j.Slf4j;

import java.util.regex.Matcher;
import java.util.regex.Pattern;

@Slf4j
public class regexUtils {

    //正则校验手机号的合法性
    public static boolean checkMobileIsLegal(String mobile){
        String regex = "1[3|4|5|7|8][0-9]{9}";
        if(mobile.length() != 11){
            return false;
        }
        Pattern p = Pattern.compile(regex);
        Matcher m = p.matcher(mobile);
        return m.matches();
    }
}
